package org.xx.armory.ofs.jpa;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;

import static javax.persistence.GenerationType.SEQUENCE;

@Entity(name = "FileRef")
@Table(name = "FS_FILE2")
@SequenceGenerator(name = "FS_ID",
                   sequenceName = "FS_FILE_ID",
                   allocationSize = 1)
@Access(AccessType.PROPERTY)
public class FileRefPO {
    private long id;
    private long objectId;
    private int fileType;
    private String name;
    private long size;
    private Date lastModifiedTime;
    private String description;
    private String brief;
    private long attributes;
    private String uuid;

    @Id
    @Column(name = "FILE_ID")
    @GeneratedValue(strategy = SEQUENCE,
                    generator = "FS_ID")
    public Long getId() {
        return this.id;
    }

    public void setId(
            long id
    ) {
        this.id = id;
    }

    @Column(name = "OBJECT_ID",
            nullable = false,
            updatable = false)
    public Long getObjectId() {
        return this.objectId;
    }

    public void setObjectId(
            long objectId
    ) {
        this.objectId = objectId;
    }

    @Column(name = "FILE_TYPE",
            nullable = false,
            updatable = false)
    public int getFileType() {
        return this.fileType;
    }

    public void setFileType(
            int fileType
    ) {
        this.fileType = fileType;
    }

    @Column(name = "FILE_NAME",
            nullable = false)
    public String getName() {
        return this.name;
    }

    public void setName(
            String name
    ) {
        this.name = name;
    }

    @Column(name = "FILE_SIZE",
            nullable = false)
    public long getSize() {
        return this.size;
    }

    public void setSize(
            long size
    ) {
        this.size = size;
    }

    @Column(name = "LAST_MODIFIED_TIME",
            nullable = false)
    public Date getLastModifiedTime() {
        return this.lastModifiedTime;
    }

    public void setLastModifiedTime(
            Date lastModifiedTime
    ) {
        this.lastModifiedTime = lastModifiedTime;
    }

    @Column(name = "DESCRIPTION")
    public String getDescription() {
        return this.description;
    }

    public void setDescription(
            String description
    ) {
        this.description = description;
    }

    @Column(name = "BRIEF")
    public String getBrief() {
        return this.brief;
    }

    public void setBrief(
            String brief
    ) {
        this.brief = brief;
    }

    @Column(name = "ATTRS",
            nullable = false)
    public long getAttributes() {
        return this.attributes;
    }

    public void setAttributes(
            long attributes
    ) {
        this.attributes = attributes;
    }

    @Column(name = "UUID")
    public String getUuid() {
        return this.uuid;
    }

    public void setUuid(
            String uuid
    ) {
        this.uuid = uuid;
    }
}
